import request from '../utils/request';
import { createTheURL } from '../utils/utils';
import API from '../config/api';

// Service的示例写法
export async function addNewCar(params) {
  return request(createTheURL(API.carAPI, 'add'), {
    method: 'GET',
    body: params,
  });
}

export async function delCarDataById(params) {
  return request(createTheURL(API.carAPI, 'delById'), {
    method: 'POST',
    body: params,
  });
}

export async function delCarGoods(params) {
  return request(createTheURL(API.carAPI, 'delgoods'), {
    method: 'DELETE',
    body: params,
  });
}

export async function editById(params) {
  return request(createTheURL(api.carAPI, 'edit'), {
    method: 'POST',
    body: params,
  });
}
export async function userListSearch(params) {
  return request(createTheURL(api.carAPI, 'list'), {
    method: 'POST',
    body: params,
  });
}